Private Sub AddChildren(nodBoss As Node, rst As DAO.Recordset)
Dim nd As Node, StrText As String, bkMark As String, FoldType As Integer, strNode As Integer
rst.FindFirst "[GroupName] ='" & nodBoss & "'"
Do Until rst.NoMatch
strNode = rst![nodeid]
StrText = rst![NodeName]
FoldType = rst!FoldImage
Set nd = TreeView1.Nodes.Add(nodBoss, tvwChild, StrText, StrText, FoldType)
nd.Tag = strNode
bkMark = rst.Bookmark
AddChildren nd, rst
rst.Bookmark = bkMark
rst.FindNext "[GroupName] ='" & nodBoss & "'"
Loop
End Sub
Private Sub AddList(nodBoss As String)
Dim nd As Node, StrText As String, bkMark As String, FoldType As Integer, DocType As String
Dim LItem As ListItem, TempText As String, TempFold As Integer
ConnectAccessDb
If nodBoss = "▐╟▄╞▄π╔ ╟ß▄╨▀φ" Then
Set rs = dbs.OpenRecordset("SELECT * FROM [Tree Table] WHERE FoldType=3 OR FoldType=4 OR FoldType=5 ", dbOpenDynaset, dbReadOnly)
Else
Set rs = dbs.OpenRecordset("SELECT * FROM [Tree Table] WHERE (FoldType=3 OR FoldType=4 OR FoldType=5) And GroupName='" & nodBoss & "'", dbOpenDynaset, dbReadOnly)
End If
Me.ListView1.ListItems.Clear
Do Until rs.EOF
StrText = rs![NodeName]
FoldType = rs!FoldType
If FoldType = 3 Then
Set LItem = ListView1.ListItems.Add(, , StrText, FoldType)
Else
Set LItem = ListView1.ListItems.Add(, , StrText, 4)